// const Vue = r => require.ensure([], () => r(require('vue')), 'chunkname1')
// const Router = r => require.ensure([], () => r(require('vue-router')), 'chunkname1')
import Vue from 'vue'
import Router from 'vue-router'
import Hello from '@/components/Hello'

// const Hello = r => require.ensure([], () => r(require('@/components/Hello')), 'chunkname1')
//
// const Project = r => require.ensure([], () => r(require('@/components/projectdetails/project-details.vue')), 'chunkname2')
// const Report = r => require.ensure([], () => r(require('@/components/report/report.vue')), 'chunkname2')
// const Donation = r => require.ensure([], () => r(require('@/components/donation/donation.vue')), 'chunkname2')
// const Homedonation = r => require.ensure([], () => r(require('@/components/homedonation/homedonation.vue')), 'chunkname2')
// const Batch = r => require.ensure([], () => r(require('@/components/batch/batch.vue')), 'chunkname2')
// const Clue = r => require.ensure([], () => r(require('@/components/clue/clue.vue')), 'chunkname2')
// const Submit = r => require.ensure([], () => r(require('@/components/submit/submit.vue')), 'chunkname2')
//
// const Findhome = r => require.ensure([], () => r(require('@/components/findhome/findhome.vue')), 'chunkname3')
// const Findshop = r => require.ensure([], () => r(require('@/components/findhome/findhome.vue')), 'chunkname3')
// const Findpublic = r => require.ensure([], () => r(require('@/components/findpublic/findpublic.vue')), 'chunkname3')
// const Findrank = r => require.ensure([], () => r(require('@/components/findrank/findrank.vue')), 'chunkname3')
// const Findmessage = r => require.ensure([], () => r(require('@/components/findmessage/findmessage.vue')), 'chunkname3')
// const Findcount = r => require.ensure([], () => r(require('@/components/findcount/findcount.vue')), 'chunkname3')
//
// const Userhome = r => require.ensure([], () => r(require('@/components/userhome/userhome.vue')), 'chunkname4')
// const Userbook = r => require.ensure([], () => r(require('@/components/userbook/userbook.vue')), 'chunkname4')
// const Useredit = r => require.ensure([], () => r(require('@/components/useredit/useredit.vue')), 'chunkname4')
// const Userdonate = r => require.ensure([], () => r(require('@/components/userdonate/userdonate.vue')), 'chunkname4')
// const Userproject = r => require.ensure([], () => r(require('@/components/userproject/userproject.vue')), 'chunkname4')
//
// const articleDetails = r => require.ensure([], () => r(require('@/components/articleDetails/articleDetails.vue')), 'chunkname5')
// const payment = r => require.ensure([], () => r(require('@/components/payment/payment.vue')), 'chunkname5')
// const aboutqyc = r => require.ensure([], () => r(require('@/components/aboutqyc/aboutqyc.vue')), 'chunkname5')
// const notificationCenter = r => require.ensure([], () => r(require('@/components/notificationCenter/notificationCenter.vue')), 'chunkname5')
// const navBottom = r => require.ensure([], () => r(require('@/components/common/nav-bottom.vue')), 'chunkname5')
//
// const noticeDetails = r => require.ensure([], () => r(require('@/components/noticeDetails/noticeDetails.vue')), 'chunkname6')
// const findmessageDetails = r => require.ensure([], () => r(require('@/components/findmessageDetails/findmessageDetails.vue')), 'chunkname6')
// const alipayTips = r => require.ensure([], () => r(require('@/components/findmessageDetails/findmessageDetails.vue')), 'chunkname6')
// const oneToOneDonation = r => require.ensure([], () => r(require('@/components/oneToOneDonation/oneToOneDonation.vue')), 'chunkname6')
// const oneToOneDetails = r => require.ensure([], () => r(require('@/components/oneToOneDetails/oneToOneDetails.vue')), 'chunkname6')
// const searchProject = r => require.ensure([], () => r(require('@/components/searchProject/searchProject.vue')), 'chunkname6')
// const everyDayKind = r => require.ensure([], () => r(require('@/components/everyDayKind/everyDayKind.vue')), 'chunkname6')
// import Project from '@/components/projectdetails/project-details.vue'
// import Report from '@/components/report/report'
// import Donation from '@/components/donation/donation.vue'
// import Homedonation from '@/components/homedonation/homedonation.vue'
// import Batch from '@/components/batch/batch.vue'
// import Clue from '@/components/clue/clue.vue'
// import Submit from '@/components/submit/submit.vue'
// import Findhome from '@/components/findhome/findhome.vue'
// import Findshop from '@/components/findshop/findshop.vue'
// import Findpublic from '@/components/findpublic/findpublic.vue'
// import Findrank from '@/components/findrank/findrank.vue'
// import Findmessage from '@/components/findmessage/findmessage.vue'
// import Findcount from '@/components/findcount/findcount.vue'
// import Userhome from '@/components/userhome/userhome.vue'
// import Userbook from '@/components/userbook/userbook.vue'
// import Useredit from '@/components/useredit/useredit.vue'
// import Userdonate from '@/components/userdonate/userdonate.vue'
// import Userproject from '@/components/userproject/userproject.vue'

// import articleDetails from '@/components/articleDetails/articleDetails.vue'
// import payment from '@/components/payment/payment.vue'
// import aboutqyc from '@/components/aboutqyc/aboutqyc.vue'
// import notificationCenter from '@/components/notificationCenter/notificationCenter.vue'
// import navBottom from '@/components/common/nav-bottom.vue'
// import noticeDetails from '@/components/noticeDetails/noticeDetails.vue'
// import findmessageDetails from '@/components/findmessageDetails/findmessageDetails.vue'
// import alipayTips from '@/components/alipayTips/alipayTips.vue'
// import oneToOneDonation from '@/components/oneToOneDonation/oneToOneDonation.vue'
// import oneToOneDetails from '@/components/oneToOneDetails/oneToOneDetails.vue'
// import searchProject from '@/components/searchProject/searchProject.vue'
Vue.use(Router)
const routers = new Router({
  routes: [{
    path: '/',
    redirect: '/Hello'
  }, {
    path: '/Hello',
    component: Hello
  }, {
    path: '/Project',
    component: resolve => {
      require(['@/components/projectdetails/project-details.vue'], resolve)
    }
  }, {
    path: '/report',
    component: resolve => {
      require(['@/components/report/report'], resolve)
    }
  }, {
    path: '/donation',
    component: resolve => {
      require(['@/components/donation/donation.vue'], resolve)
    }
  }, {
    path: '/homedonation',
    component: resolve => {
      require(['@/components/homedonation/homedonation.vue'], resolve)
    }
  }, {
    path: '/batch',
    component: resolve => {
      require(['@/components/batch/batch.vue'], resolve)
    }
  }, {
    path: '/clue',
    component: resolve => {
      require(['@/components/clue/clue.vue'], resolve)
    }
  }, {
    path: '/submit',
    component: resolve => {
      require(['@/components/submit/submit.vue'], resolve)
    }
  }, {
    path: '/findhome',
    component: resolve => {
      require(['@/components/findhome/findhome.vue'], resolve)
    }
  }, {
    path: '/findshop',
    component: resolve => {
      require(['@/components/findshop/findshop.vue'], resolve)
    }
  }, {
    path: '/findpublic',
    component: resolve => {
      require(['@/components/findpublic/findpublic.vue'], resolve)
    }
  }, {
    path: '/findrank',
    component: resolve => {
      require(['@/components/findrank/findrank.vue'], resolve)
    }
  }, {
    path: '/findmessage',
    component: resolve => {
      require(['@/components/findmessage/findmessage.vue'], resolve)
    }
  }, {
    path: '/findcount',
    component: resolve => {
      require(['@/components/findcount/findcount.vue'], resolve)
    }
  }, {
    path: '/userhome',
    component: resolve => {
      require(['@/components/userhome/userhome.vue'], resolve)
    }
  }, {
    path: '/userbook',
    component: resolve => {
      require(['@/components/userbook/userbook.vue'], resolve)
    }
  }, {
    path: '/useredit',
    component: resolve => {
      require(['@/components/useredit/useredit.vue'], resolve)
    }
  }, {
    path: '/userdonate',
    component: resolve => {
      require(['@/components/userdonate/userdonate.vue'], resolve)
    }
  }, {
    path: '/userproject',
    component: resolve => {
      require(['@/components/userproject/userproject.vue'], resolve)
    }
  }, {
    path: '/articleDetails',
    component: resolve => {
      require(['@/components/articleDetails/articleDetails.vue'], resolve)
    }
  }, {
    path: '/payment',
    component: resolve => {
      require(['@/components/payment/payment.vue'], resolve)
    }
  }, {
    path: '/aboutqyc',
    component: resolve => {
      require(['@/components/aboutqqc/aboutqqc.vue'], resolve)
    }
  }, {
    path: '/notificationCenter',
    component: resolve => {
      require(['@/components/notificationCenter/notificationCenter.vue'], resolve)
    }
  }, {
    path: '/nav-bottom',
    component: resolve => {
      require(['@/components/common/nav-bottom.vue'], resolve)
    }
  }, {
    path: '/noticeDetails',
    component: resolve => {
      require(['@/components/noticeDetails/noticeDetails.vue'], resolve)
    }
  }, {
    path: '/findmessageDetails',
    component: resolve => {
      require(['@/components/findmessageDetails/findmessageDetails.vue'], resolve)
    }
  }, {
    path: '/alipayTips',
    component: resolve => {
      require(['@/components/alipayTips/alipayTips.vue'], resolve)
    }
  }, {
    path: '/oneToOneDetails',
    component: resolve => {
      require(['@/components/oneToOneDetails/oneToOneDetails.vue'], resolve)
    }
  }, {
    path: '/donationFeedBack',
    component: resolve => {
      require(['@/components/donationFeedBack/donationFeedBack.vue'], resolve)
    }
  }],
  base: '/wx/'
})
// routers.beforeEach((to, from, next) => {
//   if (window.sessionStorage.getItem('openid')) {
//     if (to.path === '/') {
//       next('/Hello')
//     } else {
//       next()
//       console.log(123)
//     }
//   } else {
//     next(() => {
//       to.path = '/'
//     })
//   }
// })
export default routers
// const routes = [{
//   path: '/',
//   name: 'Hello',
//   component: Hello
// }, {
//   path: '/Hello',
//   name: 'Hello',
//   component: Hello
// }, {
//   // 项目详情
//   path: '/Project',
//   name: 'Project',
//   component: Project
// }, {
//   // 举报
//   path: '/report',
//   name: 'report',
//   component: Report
// }, {
//   // 邀请朋友一起捐
//   path: '/donation',
//   name: 'donation',
//   component: Donation
// }, {
//   path: '/homedonation',
//   name: 'homedonation',
//   component: Homedonation
// }, {
//   path: '/batch',
//   name: 'batch',
//   component: Batch
// }, {
//   path: '/clue',
//   name: 'clue',
//   component: Clue
// },{
//   path: '/submit',
//   name: 'submit',
//   component: Submit
// }, {
//   path: '/findhome',
//   name: 'findhome',
//   component: Findhome
// }, {
//   path: '/findshop',
//   name: 'findshop',
//   component: Findshop
// }, {
//   path: '/findpublic',
//   name: 'findpublic',
//   component: Findpublic
// }, {
//   path: '/findrank',
//   name: 'findrank',
//   component: Findrank
// }, {
//   path: '/findmessage',
//   name: 'findmessage',
//   component: Findmessage
// }, {
//   path: '/findcount',
//   name: 'findcount',
//   component: Findcount
// }, {
//   path: '/userhome',
//   name: 'userhome',
//   component: Userhome
// }, {
//   path: '/userbook',
//   name: 'userbook',
//   component: Userbook
// }, {
//   path: '/useredit',
//   name: 'useredit',
//   component: Useredit
// }, {
//   path: '/userdonate',
//   name: 'userdonate',
//   component: Userdonate
// }, {
//   path: '/userproject',
//   name: 'userproject',
//   component: Userproject
// }, {
//   path: '/articleDetails',
//   name: 'articleDetails',
//   component: articleDetails
// }, {
//   path: '/payment',
//   name: 'payment',
//   component: payment
// }, {
//   path: '/aboutqyc',
//   name: 'aboutqyc',
//   component: aboutqyc
// }, {
//   path: '/notificationCenter',
//   name: 'notificationCenter',
//   component: notificationCenter
// }, {
//   path: '/nav-bottom',
//   name: 'nav-bottom',
//   component: navBottom
// }, {
//   path: '/noticeDetails',
//   name: 'noticeDetails',
//   component: noticeDetails
// }, {
//   path: '/findmessageDetails',
//   name: 'findmessageDetails',
//   component: findmessageDetails
// }, {
//   path: '/alipayTips',
//   name: 'alipayTips',
//   component: alipayTips
// }, {
//   path: '/oneToOneDonation',
//   name: 'oneToOneDonation',
//   component: oneToOneDonation
// }, {
//   path: '/oneToOneDetails',
//   name: 'oneToOneDetails',
//   component: oneToOneDetails
// }, {
//   path: '/searchProject',
//   name: 'searchProject',
//   component: searchProject
// }, {
//   path: '/everyDayKind',
//   name: 'everyDayKind',
//   component: everyDayKind
// }]
// export default new Router({
//   routes: routes,
//   base: '/wx/'
// })
